<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>transforms</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >Metadata Crawler</th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Package&nbsp;transforms
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="transforms-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== PACKAGE DESCRIPTION ==================== -->
<h1 class="epydoc">Package transforms</h1><p class="nomargin-top"><span class="codelink"><a href="transforms-pysrc.html">source&nbsp;code</a></span></p>
<h1 class="heading">Utility functions to assist XSL transforms</h1>

<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="transforms-module.html#Transform" class="summary-sig-name">Transform</a>(<span class="summary-sig-arg">inxmlstring</span>,
        <span class="summary-sig-arg">transform</span>,
        <span class="summary-sig-arg">outxmlfile</span>)</span><br />
      Transform a metadata record to XML using an XSL stylesheet</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="transforms-pysrc.html#Transform">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="DictToXML"></a><span class="summary-sig-name">DictToXML</span>(<span class="summary-sig-arg">dic</span>,
        <span class="summary-sig-arg">root</span>)</span><br />
      Transform a metadata record to a flat XML string</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="transforms-pysrc.html#DictToXML">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="ListToXML"></a><span class="summary-sig-name">ListToXML</span>(<span class="summary-sig-arg">lst</span>,
        <span class="summary-sig-arg">root</span>)</span><br />
      Transform a metadata record to a flat XML string</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="transforms-pysrc.html#ListToXML">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="transforms-module.html#CreateMEF" class="summary-sig-name">CreateMEF</a>(<span class="summary-sig-arg">outdir</span>,
        <span class="summary-sig-arg">xmlfile</span>,
        <span class="summary-sig-arg">uid</span>,
        <span class="summary-sig-arg">overviews</span>=<span class="summary-sig-default"><code class="variable-group">[</code><code class="variable-group">]</code></span>)</span><br />
      Generate Geonetwork &quot;Metadata Exchange Format&quot; from an 
      ISO19139 XML record</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="transforms-pysrc.html#CreateMEF">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="_CreateInfo"></a><span class="summary-sig-name">_CreateInfo</span>(<span class="summary-sig-arg">uid</span>,
        <span class="summary-sig-arg">overviews</span>=<span class="summary-sig-default"><code class="variable-group">[</code><code class="variable-group">]</code></span>)</span><br />
      Create MEF info.xml file</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="transforms-pysrc.html#_CreateInfo">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Variables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="transforms-module.html#transforms" class="summary-name">transforms</a> = <code title="{'ANZLIC Profile': 'ANZLIC Metadata Profile (AS/NZS ISO 19115:2005 Geo\
graphic information - Metadata)',
 'DEWHA ISO': 'DEWHA ISO Format for DIG',
 'ESRI': 'ESRI Format'}"><code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">ANZLIC Profile</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">ANZLIC Metadata Profile (AS/N</code><code class="variable-ellipsis">...</code></code><br />
      Pre-defined XSL transforms
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="transforms-module.html#xslfiles" class="summary-name">xslfiles</a> = <code title="{'ANZLIC Profile': 'anzlic_iso19139.xsl',
 'DEWHA ISO': 'dewha_iso.xsl',
 'ESRI': 'esri.xsl'}"><code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">ANZLIC Profile</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">anzlic_iso19139.xsl</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">DEWHA IS</code><code class="variable-ellipsis">...</code></code><br />
      Pre-defined XSL files
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="_desc"></a><span class="summary-name">_desc</span> = <code title="'ESRI Format'"><code class="variable-quote">'</code><code class="variable-string">ESRI Format</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="_f"></a><span class="summary-name">_f</span> = <code title="'C:\\crawler_overviews\\lib\\transforms\\ESRI.xml'"><code class="variable-quote">'</code><code class="variable-string">C:\\crawler_overviews\\lib\\transforms\\ESRI.xml</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="_file"></a><span class="summary-name">_file</span> = <code title="'esri.xsl'"><code class="variable-quote">'</code><code class="variable-string">esri.xsl</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="_name"></a><span class="summary-name">_name</span> = <code title="'ESRI'"><code class="variable-quote">'</code><code class="variable-string">ESRI</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="Transform"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">Transform</span>(<span class="sig-arg">inxmlstring</span>,
        <span class="sig-arg">transform</span>,
        <span class="sig-arg">outxmlfile</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="transforms-pysrc.html#Transform">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Transform a metadata record to XML using an XSL stylesheet</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>inxmlstring</code></strong> - metadata record in XML format.</li>
        <li><strong class="pname"><code>transform</code></strong> - may be one of the pre-defined XSL transforms or a path to a 
          custom XSL file.</li>
        <li><strong class="pname"><code>outxmlfile</code></strong> - File to write transformed metadata to.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="CreateMEF"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">CreateMEF</span>(<span class="sig-arg">outdir</span>,
        <span class="sig-arg">xmlfile</span>,
        <span class="sig-arg">uid</span>,
        <span class="sig-arg">overviews</span>=<span class="sig-default"><code class="variable-group">[</code><code class="variable-group">]</code></span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="transforms-pysrc.html#CreateMEF">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Generate Geonetwork &quot;Metadata Exchange Format&quot; from an 
  ISO19139 XML record</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>outdir</code></strong> - Directory to write MEF file to.</li>
        <li><strong class="pname"><code>xmlfile</code></strong> - XML file to create MEF from.</li>
        <li><strong class="pname"><code>uid</code></strong> - ID of metadata record (UUID/GUID string).</li>
        <li><strong class="pname"><code>overviews</code></strong> - List of overview image file (e.g quicklooks &amp; thumbnails) 
          OPTIONAL.</li>
    </ul></dd>
  </dl>
<div class="fields">      <p><strong>See Also:</strong>
        <p>http://www.fao.org/geonetwork/docs/ch17s02.html</p>
        <p>http://trac.osgeo.org/geonetwork/wiki/MEF</p>
      </p>
      <p><strong>To Do:</strong>
        Assumes metadata is ISO19139, need to make generic somehow...
      </p>
</div></td></tr></table>
</div>
<br />
<!-- ==================== VARIABLES DETAILS ==================== -->
<a name="section-VariablesDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-VariablesDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="transforms"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">transforms</h3>
  <p>Pre-defined XSL transforms</p>
  <dl class="fields">
  </dl>
  <dl class="fields">
    <dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
<code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">ANZLIC Profile</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">ANZLIC Metadata Profile (AS/NZS ISO 19115:2005 Geo</code><span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
<code class="variable-string">graphic information - Metadata)</code><code class="variable-quote">'</code><code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">DEWHA ISO</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">DEWHA ISO Format for DIG</code><code class="variable-quote">'</code><code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">ESRI</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">ESRI Format</code><code class="variable-quote">'</code><code class="variable-group">}</code>
</pre></td></tr></table>
</dd>
  </dl>
</td></tr></table>
</div>
<a name="xslfiles"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">xslfiles</h3>
  <p>Pre-defined XSL files</p>
  <dl class="fields">
  </dl>
  <dl class="fields">
    <dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
<code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">ANZLIC Profile</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">anzlic_iso19139.xsl</code><code class="variable-quote">'</code><code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">DEWHA ISO</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">dewha_iso.xsl</code><code class="variable-quote">'</code><code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">ESRI</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">'</code><code class="variable-string">esri.xsl</code><code class="variable-quote">'</code><code class="variable-group">}</code>
</pre></td></tr></table>
</dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >Metadata Crawler</th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Wed Oct 07 14:35:45 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
